package com.logistics.mapper;

import com.logistics.pojo.Admin;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface AdminMapper {
    //根据用户名查询用户
    @Select("select * from administrators where adminname = #{adminname}")
    Admin findByAdminName(@Param("adminname") String adminname);

    //注册
    @Insert("insert into administrators(adminname,password,create_time,update_time) values(#{adminname},#{password},now(),now())")
    void add(@Param("adminname") String adminname,@Param("password") String password);

}
